package com.huopaolan.yohuoshop.Mvp.View.Activity;

import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

import com.huopaolan.yohuoshop.R;
import com.huopaolan.yohuoshop.Sp.SpUtils;

public class OutActivity extends AppCompatActivity implements OnClickListener {
    private ImageView out;
    private Button out_user;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_out);
        initView();
    }

    @Override
    protected void onStart() {
        Window window = getWindow();
        window.setStatusBarColor(Color.BLACK);
        super.onStart();
    }

    private void initView() {
        out = findViewById(R.id.out_setting);
        out_user = findViewById(R.id.out_login);
        out.setOnClickListener(this);
        out_user.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.out_setting:
                finish();
                break;
            case R.id.out_login:
                SpUtils.getInstance().SpWrite(false);
//                EventBus.getDefault().post(false);
                Toast.makeText(this, "退出用户", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
